// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import '@fortawesome/fontawesome-free/css/all.min.css'
import '@/permission' // 权限
//
import 'normalize.css/normalize.css'
// 引入ElementUI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN'
// iview
import 'iview/dist/styles/iview.css';
// animate
import animate from 'animate.css'
import 'vue2-animate/dist/vue2-animate.min.css'
Vue.use(animate)
// 引入moment.js
import moment from 'moment'
import 'moment/locale/zh-cn'
// 引入自定义工具
import {default as api} from './utils/api'
import {hasPermission} from "./utils/hasPermission";
// 引入粒子特效
import VueParticles from 'vue-particles'
Vue.use(VueParticles)
// 图片预览：
// 在img标签添加preview属性 preview值相同即表示为同一组
// <img src="xxx.jpg" preview="0" preview-text="描述文字">
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.use(preview)
// 其他
import config from './utils/config' // vue通用全局配置
Vue.use(config);
import Tools from './utils/tools'
Vue.prototype.$tools = Tools;

//引入图片查看器
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(Viewer, {
  defaultOptions: {
    zIndex: 9999
  }
})

// 暂无信息提示信息
import EmptyTip from './views/modules/common/EmptyTip'
Vue.component('EmptyTip', EmptyTip);

import axios from 'axios'
Vue.prototype.baseAxios = (axios)

Vue.prototype.api = api
Vue.prototype.$moment = moment;
Vue.use(ElementUI, {locale});
//全局的常量
Vue.prototype.hasPerm = hasPermission

//生产环境时自动设置为 false 以阻止 vue 在启动时生成生产提示。
Vue.config.productionTip = false

// 通用组件注册
import TopRightMsg from './views/layout/components/TopRightMsg'

Vue.component('TopRightMsg', TopRightMsg);

/* eslint-disable no-new */
const app = new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
